<?php
Zend::loadClass('Lead_EDO_Datatype_Field');

/**
 * Datatype for bigint
 * 
 * @package EDO
 * @subpackage Datatypes
 *
 */
class Lead_EDO_Datatype_Bigint extends Lead_EDO_Datatype_Field
{
	protected $_SQLValueIsQuoted = false;
	
	function validate($validate)
	{
		if(!$this->notNull() AND empty($validate) AND !is_numeric($validate))
    		return null;

    	if(!is_numeric($validate))
			return false;
    	
	    if ((string)$validate !== (string)(int)$validate)
	       return false;
			
		$validate = intval($validate);	
		
		if($validate < -9223372036854775808	OR $validate > 9223372036854775808)
			 return false;
		
		return $validate;			
		
		
	}
	
	
	
}